
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3"></script>
</head>
<body>
    <div id="app">
       <p><h1>count的值是：{{count}}</h1></p>
       <button v-on:click="addCount">+1</button>
       <!-- <button @click="count  +=1">+1</button> -->

       <button @click="addCount">+1</button>
    </div>
    
    <script>
        const { createApp } = Vue
        createApp({
          data() {
            return {
              count:0,
            }
          },
          methods:{
            addCount(){
              this.count +=1
            }
          }
        }).mount('#app')
      </script>
</body>
</html>